package com.deli.utils;

import com.deli.entity.CurrentUser;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;

/**
 * @Auther: Administrator
 * @Date: 2018/8/18 21:27
 * @Description:
 */
public class ShiroUtil {
    public static Subject getSubject() {
        return SecurityUtils.getSubject();
    }

    public static Session getSession() {
        return SecurityUtils.getSubject().getSession();
    }

    public static CurrentUser getCurrentUser() {
        return (CurrentUser)getSession().getAttribute("currentUser");
    }
}
